package com.changanw.tienchin.activity.domain.vo;


import com.changanw.tienchin.common.validator.CreateGroup;
import com.changanw.tienchin.common.validator.EditGroup;
import com.changanw.tienchin.common.annotation.Excel;
import com.changanw.tienchin.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * @author changanw
 * @description
 * @date 2023/11/22 11:06
 */
public class ActivityVo extends BaseEntity {
  /**
   * 活动id
   */
  @NotNull(message = "{activity.id.notnull}",groups = EditGroup.class)
  @Excel(name = "活动Id")
  private Integer activityId;

  /**
   * 活动名称
   */
  @NotNull(message = "{activity.name.notblank}",groups = {EditGroup.class, CreateGroup.class})
  @Size(min = 0,max = 20 ,message = "{activity.name.size}")
  @Excel(name = "活动名称")
  private String activityName;

  /**
   * 渠道id
   */
  @NotNull
  @Excel(name = "渠道Id")
  private Integer channelId;
  @Excel(name = "渠道名称")
  private String channelName;

  /**
   * 活动简介
   */
  @NotBlank(message = "{activity.info.notblank}",groups = {EditGroup.class, CreateGroup.class})
  @Size(min = 0,max = 255,message = "{activity.info.size}")
  @Excel(name = "活动简介")
  private String info;

  /**
   * 活动类型 1 折扣券 2代金券
   */
  @Excel(name = "活动类型", readConverterExp = "1=折扣券,2=代金券")
  private Integer type;

  /**
   * 折扣券
   */
  @Max(value = 10,message = "{activity.discount.invalid}")
  @Min(value = 0,message = "{activity.discount.invalid}")
  @Excel(name = "活动折扣")
  private Double discount;

  /**
   * 代金券
   */
  @Min(value = 0,message = "{activity.voucher.invalid}")
  @Excel(name = "活动代金券")
  private Double voucher;

  /**
   * 活动状态
   */
  @Max(value = 1,message = "{activity.status.invalid}")
  @Min(value = 0,message = "{activity.status.invalid}")
  @Excel(name = "活动状态", readConverterExp = "1=正常,0=过期")
  private Integer status;

  /**
   * 开始时间
   */
  @NotNull(message = "{activity.beginTime.notnull}",groups = {EditGroup.class, CreateGroup.class})
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
  @Excel(name = "活动开始时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime beginTime;

  /**
   * 结束时间
   */
  @NotNull(message = "{activity.endTime.notnull}",groups = {EditGroup.class, CreateGroup.class})
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
  @Excel(name = "活动结束时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime endTime;

  /**
   * 备注
   */
  @Excel(name = "活动备注")
  private String remark;

  private Integer delFlag;

  public Integer getActivityId() {
    return activityId;
  }

  public void setActivityId(Integer activityId) {
    this.activityId = activityId;
  }

  public String getActivityName() {
    return activityName;
  }

  public void setActivityName(String activityName) {
    this.activityName = activityName;
  }

  public Integer getChannelId() {
    return channelId;
  }

  public void setChannelId(Integer channelId) {
    this.channelId = channelId;
  }

  public String getInfo() {
    return info;
  }

  public void setInfo(String info) {
    this.info = info;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public Double getDiscount() {
    return discount;
  }

  public void setDiscount(Double discount) {
    this.discount = discount;
  }

  public Double getVoucher() {
    return voucher;
  }

  public void setVoucher(Double voucher) {
    this.voucher = voucher;
  }

  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }

  public LocalDateTime getBeginTime() {
    return beginTime;
  }

  public void setBeginTime(LocalDateTime beginTime) {
    this.beginTime = beginTime;
  }

  public LocalDateTime getEndTime() {
    return endTime;
  }

  public void setEndTime(LocalDateTime endTime) {
    this.endTime = endTime;
  }

  @Override
  public String getRemark() {
    return remark;
  }

  @Override
  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Integer getDelFlag() {
    return delFlag;
  }

  public void setDelFlag(Integer delFlag) {
    this.delFlag = delFlag;
  }

  public String getChannelName() {
    return channelName;
  }

  public void setChannelName(String channelName) {
    this.channelName = channelName;
  }
}
